import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/smart_warehouse/warehouse_device_static_entity.dart';

WarehouseDeviceStaticEntity $WarehouseDeviceStaticEntityFromJson(Map<String, dynamic> json) {
  final WarehouseDeviceStaticEntity warehouseDeviceStaticEntity = WarehouseDeviceStaticEntity();
  final int? alarmNum = jsonConvert.convert<int>(json['alarmNum']);
  if (alarmNum != null) {
    warehouseDeviceStaticEntity.alarmNum = alarmNum;
  }
  final int? dosage = jsonConvert.convert<int>(json['dosage']);
  if (dosage != null) {
    warehouseDeviceStaticEntity.dosage = dosage;
  }
  final int? drugLimit = jsonConvert.convert<int>(json['drugLimit']);
  if (drugLimit != null) {
    warehouseDeviceStaticEntity.drugLimit = drugLimit;
  }
  final int? fan = jsonConvert.convert<int>(json['fan']);
  if (fan != null) {
    warehouseDeviceStaticEntity.fan = fan;
  }
  final double? humidity = jsonConvert.convert<double>(json['humidity']);
  if (humidity != null) {
    warehouseDeviceStaticEntity.humidity = humidity;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    warehouseDeviceStaticEntity.id = id;
  }
  final int? inRecord = jsonConvert.convert<int>(json['inRecord']);
  if (inRecord != null) {
    warehouseDeviceStaticEntity.inRecord = inRecord;
  }
  final String? mac = jsonConvert.convert<String>(json['mac']);
  if (mac != null) {
    warehouseDeviceStaticEntity.mac = mac;
  }
  final int? numberOfPieces = jsonConvert.convert<int>(json['numberOfPieces']);
  if (numberOfPieces != null) {
    warehouseDeviceStaticEntity.numberOfPieces = numberOfPieces;
  }
  final int? outRecord = jsonConvert.convert<int>(json['outRecord']);
  if (outRecord != null) {
    warehouseDeviceStaticEntity.outRecord = outRecord;
  }
  final int? relTimePerson = jsonConvert.convert<int>(json['relTimePerson']);
  if (relTimePerson != null) {
    warehouseDeviceStaticEntity.relTimePerson = relTimePerson;
  }
  final int? restrictedPersonnel = jsonConvert.convert<int>(json['restrictedPersonnel']);
  if (restrictedPersonnel != null) {
    warehouseDeviceStaticEntity.restrictedPersonnel = restrictedPersonnel;
  }
  final String? states = jsonConvert.convert<String>(json['states']);
  if (states != null) {
    warehouseDeviceStaticEntity.states = states;
  }
  final double? temperature = jsonConvert.convert<double>(json['temperature']);
  if (temperature != null) {
    warehouseDeviceStaticEntity.temperature = temperature;
  }
  final String? videoUrl = jsonConvert.convert<String>(json['videoUrl']);
  if (videoUrl != null) {
    warehouseDeviceStaticEntity.videoUrl = videoUrl;
  }
  final String? warehouseLevel = jsonConvert.convert<String>(json['warehouseLevel']);
  if (warehouseLevel != null) {
    warehouseDeviceStaticEntity.warehouseLevel = warehouseLevel;
  }
  final String? warehouseName = jsonConvert.convert<String>(json['warehouseName']);
  if (warehouseName != null) {
    warehouseDeviceStaticEntity.warehouseName = warehouseName;
  }
  return warehouseDeviceStaticEntity;
}

Map<String, dynamic> $WarehouseDeviceStaticEntityToJson(WarehouseDeviceStaticEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['alarmNum'] = entity.alarmNum;
  data['dosage'] = entity.dosage;
  data['drugLimit'] = entity.drugLimit;
  data['fan'] = entity.fan;
  data['humidity'] = entity.humidity;
  data['id'] = entity.id;
  data['inRecord'] = entity.inRecord;
  data['mac'] = entity.mac;
  data['numberOfPieces'] = entity.numberOfPieces;
  data['outRecord'] = entity.outRecord;
  data['relTimePerson'] = entity.relTimePerson;
  data['restrictedPersonnel'] = entity.restrictedPersonnel;
  data['states'] = entity.states;
  data['temperature'] = entity.temperature;
  data['videoUrl'] = entity.videoUrl;
  data['warehouseLevel'] = entity.warehouseLevel;
  data['warehouseName'] = entity.warehouseName;
  return data;
}

extension WarehouseDeviceStaticEntityExtension on WarehouseDeviceStaticEntity {
  WarehouseDeviceStaticEntity copyWith({
    int? alarmNum,
    int? dosage,
    int? drugLimit,
    int? fan,
    double? humidity,
    String? id,
    int? inRecord,
    String? mac,
    int? numberOfPieces,
    int? outRecord,
    int? relTimePerson,
    int? restrictedPersonnel,
    String? states,
    double? temperature,
    String? videoUrl,
    String? warehouseLevel,
    String? warehouseName,
  }) {
    return WarehouseDeviceStaticEntity()
      ..alarmNum = alarmNum ?? this.alarmNum
      ..dosage = dosage ?? this.dosage
      ..drugLimit = drugLimit ?? this.drugLimit
      ..fan = fan ?? this.fan
      ..humidity = humidity ?? this.humidity
      ..id = id ?? this.id
      ..inRecord = inRecord ?? this.inRecord
      ..mac = mac ?? this.mac
      ..numberOfPieces = numberOfPieces ?? this.numberOfPieces
      ..outRecord = outRecord ?? this.outRecord
      ..relTimePerson = relTimePerson ?? this.relTimePerson
      ..restrictedPersonnel = restrictedPersonnel ?? this.restrictedPersonnel
      ..states = states ?? this.states
      ..temperature = temperature ?? this.temperature
      ..videoUrl = videoUrl ?? this.videoUrl
      ..warehouseLevel = warehouseLevel ?? this.warehouseLevel
      ..warehouseName = warehouseName ?? this.warehouseName;
  }
}
